The FSMakeFSSpec function allows you to create FSSpec records.
You can use the FSMakeFSSpec function to initialize an FSSpec record to particular values for a file or directory.
FUNCTION FSMakeFSSpec (vRefNum: Integer; dirID: LongInt;
fileName: Str255; VAR spec: FSSpec):
OSErr;
The FSMakeFSSpec function fills in the fields of the spec parameter using the information contained in the other three parameters. Call FSMakeFSSpec whenever you want to create an FSSpec record.
You can pass the input to FSMakeFSSpec in several ways. The chapter "File Manager" in this book explains how FSMakeFSSpec interprets its input.
If the specified volume is mounted and the specified parent directory exists, but the target file or directory doesn't exist in that location, FSMakeFSSpec fills in the record and then returns fnfErr instead of noErr . The record is valid, but it describes a target that doesn't exist. You can use the record for other operations, such as creating a file with the FSpCreate function.
In addition to the result codes that follow, FSMakeFSSpec can return a number of other File Manager error codes. If your application receives any result code other than noErr or fnfErr , all fields of the resulting FSSpec record are set to 0.